import java.util.Scanner;

public class One {
    public static void main(String[] args) {
        Scanner in=new Scanner(System.in);
        int q=in.nextInt();
        int a,b,c;
        while (q--!=0){
            a=in.nextInt();
            b=in.nextInt();
            c=in.nextInt();
            int x=Math.min(a,Math.min(b,c));
            System.out.println(x*2+Math.max(b-x-1,0));
        }
    }
}
